package com.projectName.www.dao;

import com.projectName.www.po.message;

import java.sql.ResultSet;

public class S_J_selectmessage_dao {

    public static boolean insert(message m) throws Exception {

        String sql ="insert ignore into message (shopname,message) values(?,?)";
        int i=BaseDao.executeUpdata(sql,m.getShopname(),m.getMessage());
        if(i>0)return true;
        else  return false;
    }
    public static boolean delete(String messgae) throws Exception {
        String sql ="delete from message where message=?";
        int i =BaseDao.executeUpdata(sql ,messgae);
        if(i>0)return true;
        else  return false;
    };
    public static ResultSet getmessage() throws Exception {
        String sql ="select * from message";
        ResultSet resultSet = BaseDao.executeQuery(sql);
        return resultSet;
    }
    public static boolean deletemessage(String messgage) throws Exception {
        String sql="delete from message where message=?";
        int i = BaseDao.executeUpdata(sql, messgage);
        if(i>0)return true;
        else return false;
    }


}


